package zuoye2;

import java.util.Scanner;

public class Demo10 {
    public static void main(String[] args) {
        System.out.println("输入一个小于10的整数");
        int n = new Scanner(System.in).nextInt();
        int num = 1;
        if (n < 0 || n >= 10) {
            System.err.println("输入错误");
        } else {
            for (int i = n; i > 0; i--) {
                num = num * i;
            }
        }
        System.out.println(n + "的阶乘为：" + num);

    }
}
